const Koa = require('koa')
const cors = require('koa2-cors')
const bodyParser = require('koa-bodyparser')
const goodsRouter = require('./router/goods')
const productionRouter = require('./router/production')
const roleRouter = require('./router/role')
const dictionaryRouter = require('./router/dictionary')
const app = new Koa()
app.use(cors())
app.use(bodyParser())


app.use(goodsRouter.routes(), goodsRouter.allowedMethods())
app.use(productionRouter.routes(), productionRouter.allowedMethods())
app.use(roleRouter.routes(), roleRouter.allowedMethods())
app.use(dictionaryRouter.routes(), dictionaryRouter.allowedMethods())
const port = 3010;
app.listen(port);
console.log(`服务启动成功,端口号为${port}`)